<?php

namespace App\Console\Commands;

use App\Models\Assess\OrderAndCustomersOrderDetailModel;
use App\Services\Assess\ActivateService;
use App\Services\Common\CommonService;
use Eccang\OpenApi\Contracts\Config;
use Eccang\OpenApi\Eccang;
use Eccang\OpenApi\Order\Request\OrderListRequest;
use Eccang\OpenApi\System\Request\AppUnityRequest;
use Eccang\OpenApi\System\Request\BaseUserInfoRequest;
use Eccang\OpenApi\System\Request\TenantAccessTokenRequest;
use Eccang\OpenApi\System\Request\UnityRequest;
use Eccang\OpenApi\System\Request\UserAccessTokenRequest;
use Illuminate\Console\Command;

class Test extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'Test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '同步商品角标信息到store_goods_corner_marks表';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {

        $ActivateService = new ActivateService();
        $ActivateService->imapReceive();
        dd('123213');

        $ActivateService = new ActivateService();
        $as = $ActivateService->emailoutlook([],[]);
        dd($as);


//        $OrderAndCustomersOrderDetailModel = new OrderAndCustomersOrderDetailModel();
//        $detailData = $OrderAndCustomersOrderDetailModel
//            ->where('product_category_name1','!=','')
//            ->groupBy(['platform_sku','product_category_code1','product_category_code2','product_category_code3','product_category_name1','product_category_name2','product_category_name3'])
//            ->get(['platform_sku','product_category_code1','product_category_code2','product_category_code3','product_category_name1','product_category_name2','product_category_name3'])->toArray();
//
//        foreach ($detailData as $val){
//            $data = [
//                'product_category_code1'=>$val['product_category_code1'],
//                'product_category_code2'=>$val['product_category_code2'],
//                'product_category_code3'=>$val['product_category_code3'],
//                'product_category_name1'=>$val['product_category_name1'],
//                'product_category_name2'=>$val['product_category_name2'],
//                'product_category_name3'=>$val['product_category_name3']
//            ];
//            $OrderAndCustomersOrderDetailModel->where('platform_sku','=',$val['platform_sku'])->update($data);
//        }
//        dd('success');
    }
}

